.class Lcom/nemustech/tiffany/world/TFView$GLThreadManager;
.super Ljava/lang/Object;
.source "TFView.java"


# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
    value = Lcom/nemustech/tiffany/world/TFView;
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0xa
    name = "GLThreadManager"
.end annotation


# static fields
.field private static TAG:Ljava/lang/String; = null

.field private static final kGLES_20:I = 0x20000

.field private static final kMSM7K_RENDERER_PREFIX:Ljava/lang/String; = "Q3Dimension MSM7500 "


# instance fields
.field private mEglOwner:Lcom/nemustech/tiffany/world/TFView$GLThread;

.field private mGLESDriverCheckComplete:Z

.field private mGLESVersion:I

.field private mGLESVersionCheckComplete:Z

.field private mMultipleGLESContextsAllowed:Z


# direct methods
.method static constructor <clinit>()V
    .locals 1

    .prologue
    .line 1654
    const-string v0, "GLThreadManager"

    sput-object v0, Lcom/nemustech/tiffany/world/TFView$GLThreadManager;->TAG:Ljava/lang/String;

    return-void
.end method

.method private constructor <init>()V
    .locals 0

    .prologue
    .line 1653
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    return-void
.end method

.method synthetic constructor <init>(Lcom/nemustech/tiffany/world/TFView$1;)V
    .locals 0
    .parameter "x0"

    .prologue
    .line 1653
    invoke-direct {p0}, Lcom/nemustech/tiffany/world/TFView$GLThreadManager;-><init>()V

    return-void
.end method


# virtual methods
.method public releaseEglContextLocked(Lcom/nemustech/tiffany/world/TFView$GLThread;)V
    .locals 1
    .parameter "thread"

    .prologue
    .line 1699
    iget-object v0, p0, Lcom/nemustech/tiffany/world/TFView$GLThreadManager;->mEglOwner:Lcom/nemustech/tiffany/world/TFView$GLThread;

    if-ne v0, p1, :cond_0

    .line 1700
    const/4 v0, 0x0

    iput-object v0, p0, Lcom/nemustech/tiffany/world/TFView$GLThreadManager;->mEglOwner:Lcom/nemustech/tiffany/world/TFView$GLThread;

    .line 1702
    :cond_0
    invoke-virtual {p0}, Ljava/lang/Object;->notifyAll()V

    .line 1703
    return-void
.end method

.method public declared-synchronized shouldReleaseEGLContextWhenPausing()Z
    .locals 1

    .prologue
    .line 1709
    monitor-enter p0

    const/4 v0, 0x1

    monitor-exit p0

    return v0
.end method

.method public declared-synchronized shouldTerminateEGLWhenPausing()Z
    .locals 1

    .prologue
    .line 1713
    monitor-enter p0

    :try_start_0
    iget-boolean v0, p0, Lcom/nemustech/tiffany/world/TFView$GLThreadManager;->mMultipleGLESContextsAllowed:Z
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    if-nez v0, :cond_0

    const/4 v0, 0x1

    :goto_0
    monitor-exit p0

    return v0

    :cond_0
    const/4 v0, 0x0

    goto :goto_0

    :catchall_0
    move-exception v0

    monitor-exit p0

    throw v0
.end method

.method public declared-synchronized threadExiting(Lcom/nemustech/tiffany/world/TFView$GLThread;)V
    .locals 1
    .parameter "thread"

    .prologue
    .line 1660
    monitor-enter p0

    const/4 v0, 0x1

    :try_start_0
    invoke-static {p1, v0}, Lcom/nemustech/tiffany/world/TFView$GLThread;->access$1202(Lcom/nemustech/tiffany/world/TFView$GLThread;Z)Z

    .line 1661
    iget-object v0, p0, Lcom/nemustech/tiffany/world/TFView$GLThreadManager;->mEglOwner:Lcom/nemustech/tiffany/world/TFView$GLThread;

    if-ne v0, p1, :cond_0

    .line 1662
    const/4 v0, 0x0

    iput-object v0, p0, Lcom/nemustech/tiffany/world/TFView$GLThreadManager;->mEglOwner:Lcom/nemustech/tiffany/world/TFView$GLThread;

    .line 1664
    :cond_0
    invoke-virtual {p0}, Ljava/lang/Object;->notifyAll()V
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    .line 1665
    monitor-exit p0

    return-void

    .line 1660
    :catchall_0
    move-exception v0

    monitor-exit p0

    throw v0
.end method

.method public tryAcquireEglContextLocked(Lcom/nemustech/tiffany/world/TFView$GLThread;)Z
    .locals 2
    .parameter "thread"

    .prologue
    const/4 v1, 0x1

    .line 1675
    iget-object v0, p0, Lcom/nemustech/tiffany/world/TFView$GLThreadManager;->mEglOwner:Lcom/nemustech/tiffany/world/TFView$GLThread;

    if-eq v0, p1, :cond_0

    iget-object v0, p0, Lcom/nemustech/tiffany/world/TFView$GLThreadManager;->mEglOwner:Lcom/nemustech/tiffany/world/TFView$GLThread;

    if-nez v0, :cond_1

    .line 1676
    :cond_0
    iput-object p1, p0, Lcom/nemustech/tiffany/world/TFView$GLThreadManager;->mEglOwner:Lcom/nemustech/tiffany/world/TFView$GLThread;

    .line 1677
    invoke-virtual {p0}, Ljava/lang/Object;->notifyAll()V

    move v0, v1

    .line 1691
    :goto_0
    return v0

    .line 1681
    :cond_1
    iget-boolean v0, p0, Lcom/nemustech/tiffany/world/TFView$GLThreadManager;->mMultipleGLESContextsAllowed:Z

    if-eqz v0, :cond_2

    move v0, v1

    .line 1682
    goto :goto_0

    .line 1688
    :cond_2
    iget-object v0, p0, Lcom/nemustech/tiffany/world/TFView$GLThreadManager;->mEglOwner:Lcom/nemustech/tiffany/world/TFView$GLThread;

    if-eqz v0, :cond_3

    .line 1689
    iget-object v0, p0, Lcom/nemustech/tiffany/world/TFView$GLThreadManager;->mEglOwner:Lcom/nemustech/tiffany/world/TFView$GLThread;

    invoke-virtual {v0}, Lcom/nemustech/tiffany/world/TFView$GLThread;->requestReleaseEglContextLocked()V

    .line 1691
    :cond_3
    const/4 v0, 0x0

    goto :goto_0
.end method
